﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="list.aspx.cs" Inherits="StoreWeb.system.purchaseManage.list" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
<script type="text/javascript" src="../../lib/html5.js"></script>
<script type="text/javascript" src="../../lib/respond.min.js"></script>
<script type="text/javascript" src="../../lib/PIE_IE678.js"></script>
<![endif]-->
    <link href="../../css/H-ui.min.css" rel="stylesheet" type="text/css" />
    <link href="../../css/H-ui.admin.css" rel="stylesheet" type="text/css" />
    <link href="../../css/style.css" rel="stylesheet" type="text/css" />
    <link href="../../lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
    <link href="../../css/extension.css" rel="stylesheet" />
    <!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
    <title>采购订单列表</title>
</head>
<body>
  <form id="form" runat="server">
     <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 采购管理 <span class="c-gray en">&gt;</span> 采购订单列表 <a class="btn btn-success radius r mr-20" style="line-height: 1.6em; margin-top: 3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a></nav>
    <div class="pd-20">
        <div class="text-c">
                    <%--<span class="select-box inline">
                        <asp:DropDownList ID="typelist" CssClass="select" runat="server"></asp:DropDownList>
                    </span>--%>
                   <%-- <input type="text" class="input-text" style="width: 250px" placeholder="输入门店名称" id="name" name="name" runat="server">--%>

                     门店：
                    <input type="text" class="input-text" style="width:200px" value="" placeholder="" id="selsectdealers" name="user-tel" runat="server"  readonly>
                    <input type="hidden" id="dealers" value="" runat="server">
                    <a title="选择门店" href="javascript:;" onclick="admin_role_add('门店', 'adduser.aspx', '560px', '400px')" class="label label-success radius">选择门店 </a>
                    　
                     <input id="startTime" runat="server" class="Wdate input-text" style="width:150px;" type="text" placeholder="下单开始时间" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'endTime\')||\'2020-10-01\'}'})" />
                                &nbsp;-&nbsp;
                     <input id="endTime" class="Wdate input-text" type="text"  style="width:150px;" placeholder="下单结束时间" runat="server" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'startTime\')}',maxDate:'2020-10-01'})" />

                    <%--　
                     交易类型：
                    <span class="select-box" style="width:150px">
			        <select class="select" name="type" id="type" size="1" runat="server">
                        <option value="" selected>不限类型</option>
				        <option value="销售订单" >销售订单</option>
				        <option value="门店采购单">门店采购单</option>
                        <option value="门店充值">门店充值</option>
			        </select>
			        </span>--%>
                    　　　
                    <asp:Button ID="btnserach" class="btn btn-success radius" runat="server" Text="搜索" OnClick="btnserach_Click" />
        </div>
        <div class="cl pd-5 bg-1 bk-gray"><span class="l"><%--<a name="ca"  class="btn btn-primary radius" href="system/purchaseManage/addpurchase.aspx" ><i class="Hui-iconfont">&#xe600;</i> 添加采购订单</a>--%>    </span><span class="r">共有数据：<strong><%=AspNetPager1.RecordCount %></strong> 条</span> </div>
        <table class="table table-border table-bordered table-hover table-bg table-sort">
            <thead>
                <tr>
                    <th scope="col" colspan="9">采购订单</th>
                </tr>
                <tr class="text-c">
                   <%-- <th width="25"><input type="checkbox" name="" value=""></th>--%>
				    <th width="120">门店</th>
				    <th width="110">下单时间</th>
				    <th width="100">订单号</th>
				    <th width="120">商品名称</th>
                    <th width="90">总计金额</th>
                    <th width="90">快递信息</th>
				    <th width="90">发货时间</th>
				    <th width="60">订单状态</th>
				    <th width="90">操作</th>
				   <%-- <th width="100">操作</th>--%>
                </tr>
            </thead>
            <tbody>
                <asp:Repeater ID="Repeater1" runat="server">
                    <ItemTemplate>
                        <tr class="text-c">
                            
                           <%-- <td><%#Eval("id") %></td>--%>
                            <td><%#GetDealersName(Eval("dealersid").ToString())%></td>
                            <td><%#Eval("createtime") %></td>
                            <td><%#Eval("ordercode") %></td>
                            <td><%#GetLenth(Eval("productname").ToString())%></td>
                            <td><%#Eval("pricesum") %></td>
                            <td><%#Eval("expressinfo") %></td>
                            <td><%#Eval("deliverytime") %></td>
                            <td><%#Eval("orderstatus") %></td>
                             <td class="f-14">
                                <a title="详情" href="javascript:;" onclick="admin_role_edit('采购单详情','purchaseDetail.aspx','<%#Eval("id") %>',860,500)" style="text-decoration: none">详情</a> 

                                 <%#GetOrderstatus(Eval("orderstatus").ToString(),Eval("id").ToString())%>
                             </td>
                            
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>

            </tbody>
        </table>
        <div>
                   <asp:HiddenField ID="hidwhere" runat="server" />
            <webdiyer:AspNetPager ID="AspNetPager1" runat="server" FirstPageText="首页" NextPageText="下一页" LastPageText="尾页" PrevPageText="上一页" UrlPaging="true" CssClass="pagination" LayoutType="Ul" PagingButtonLayoutType="UnorderedList" PagingButtonSpacing="0" CurrentPageButtonClass="active" PageSize="15" OnPageChanged="AspNetPager1_PageChanged">
            </webdiyer:AspNetPager>
        </div>
    </div>
  </form>

    <script type="text/javascript" src="../../lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="../../lib/layer/1.9.3/layer.js"></script>
    <script type="text/javascript" src="../../lib/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="../../js/H-ui.js"></script>
    <script type="text/javascript" src="../../js/H-ui.admin.js"></script>
    <script type="text/javascript">

        function admin_role_add(title, url, w, h) {
            //layer_show(title, url, w, h);
            layer.open({
                type: 2,
                title: title,
                area: [w, h],
                content: url,
                success: function () {
                    var $input = $('#selsectdealers');
                    var $hidden = $('#dealers');
                    $adduser = layer.getChildFrame('#myTable a.adduser');
                    $adduser.click(function () {
                        var $this = $(this);
                        $input.val($this.data('text'));
                        $hidden.val($this.data('id'))
                        layer.closeAll();
                    });
                }
            });
        }


      
        /*详情*/
        function admin_role_edit(title, url, id, w, h) {
            //alert(id);
            layer_show(title, url + "?id=" + id, w, h);
        }
        /*作废*/
        function admin_role_del(obj, id) {
            layer.confirm('确认要作废吗？', function (index) {
                //此处请求后台程序，下方是成功后的前台处理……
                $.post("../../ajax/purchaseManage.aspx", { action: "delete", id: id },
                       function (data) {
                       if (data == "1") {
                           layer.msg('已作废!', { icon: 1, time: 1000 });
                           location.reload();
                       } else {
                           $(obj).parents("tr").remove();
                           parent.layer.msg("操作失败", { icon: 1, time: 1000 });
                       }
                   });
            });
        }
        /*审核*/
        function admin_role_confirm(obj, id) {
            layer.confirm('确认审核通过吗？', function (index) {
                //此处请求后台程序，下方是成功后的前台处理……
                $.post("../../ajax/purchaseManage.aspx", { action: "confirm", id: id },
                       function (data) {
                           if (data == "1") {
                               layer.msg('已审核!', { icon: 1, time: 1000 });
                               location.reload();
                           } else {
                               $(obj).parents("tr").remove();
                               parent.layer.msg("操作失败", { icon: 1, time: 1000 });
                           }
                       });
            });
        }
        /*确认收货*/
        function admin_role_sh(obj, id) {
            layer.confirm('确认已收货吗？', function (index) {
                //此处请求后台程序，下方是成功后的前台处理……
                $.post("../../ajax/purchaseManage.aspx", { action: "sh", id: id },
                       function (data) {
                           if (data == "2") {
                               layer.msg('已收货!', { icon: 1, time: 1000 });
                               location.reload();
                           } else {
                               $(obj).parents("tr").remove();
                               parent.layer.msg("操作失败", { icon: 1, time: 1000 });
                           }
                       });
            });
        }
        /*发货*/
        function admin_role_fh(title, url, id, w, h) {
            layer_show(title, url + "?id=" + id, w, h);
        }
    </script>
</body>
</html>
